package myjava;

/**
 * @ClassName T0
 * @Description 字符串的等于和equals
 * @Author Fanxc
 * @DATE 2021/4/29 10:10
 * @Version 1.0
 */
public class T0 {
    public static void main(String[] args) {
        String s1 = "HelloWorld";
        String s2 = new String("HelloWorld");
        if (s1 == s2) {
            System.out.println("s1 == s2");
        } else {
            System.out.println("s1 != s2");
        }
        if (s1.equals(s2)) {
            System.out.println("s1 equals s2");
        } else {
            System.out.println("s1 not equals s2");
        }
    }
}
